const db = require('../db/index')

exports.getMapData = (req, res) => {
  const text = req.query.text;
  // const layers = req.query.layers;
  const jsonData = db.getJsonFromFile(text)
  jsonData.then((data) => {
    res.json(data)
  }).catch((err) => {
    res.status(500).json({
      error: 'Failed to retrieve data',
      details: err.message // 可以根据需要添加更多的错误信息
    });
  })
}